package com.yh.workbill.db;

import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;

@Dao
public interface UserInfoDao {

    @Query("SELECT * FROM t_userinfo where  phone =:phone")
    LiveData<UserInfo> getUserInfo(String phone);

    @Delete
    void delect(UserInfo userInfo);

    @Insert
    void add(UserInfo userInfo);

    @Query("UPDATE t_userinfo SET token=:token WHERE phone=:phone")
    void update(String phone, String token);


    @Query("SELECT * FROM t_userinfo where  phone =:phone")
    UserInfo getSingleUserInfo(String phone);

}
